package com.labichaoka.chaoka.ui.home.fragment.my.message;

import android.content.Context;
import android.graphics.Typeface;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.labichaoka.chaoka.R;
import com.labichaoka.chaoka.entity.MessageListResponse;

import java.util.List;

import butterknife.BindView;


/**
 * Created by ruan on 2018/7/26.
 */

public class MessageAdapter extends BaseQuickAdapter<MessageListResponse.DataBean, BaseViewHolder> {
    @BindView(R.id.detail_layout)
    RelativeLayout detailLayout;
    private Typeface iconfont;

    public MessageAdapter(Context context, List<MessageListResponse.DataBean> data) {
        super(R.layout.item_message, data);
        iconfont = Typeface.createFromAsset(context.getAssets(), "iconfont/iconfont.ttf");
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageListResponse.DataBean item) {
        helper.setText(R.id.time,item.getCreateTime());
        helper.setText(R.id.title,item.getMsgContent().getMessTitle());
        helper.setText(R.id.content,item.getMsgContent().getMessContent());
        helper.setTypeface(R.id.next,iconfont);

    }

    @Override
    public void onViewRecycled(BaseViewHolder holder) {
        super.onViewRecycled(holder);
    }
}



